<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="format-detection" content="telephone=no">
<meta name="HandheldFriendly" content="true" />
{php include $this->template('shoucecss');}
<style type="text/css">
.header { width: 100%; height: 50px; line-height: 50px; position: fixed; z-index: 1000; top: 0; left: 0; box-shadow: 0 0 2px 0px rgba(0,0,0,0.3),0 0 6px 2px rgba(0,0,0,0.15); }
.header .l { width: 50px; height: 50px; line-height: 50px; color: white; position: absolute; left: 0; top: 0; } 
.header .m { width: 100%; height: 50px; line-height: 50px; text-align: center; color: white; font-size: 18px; } 
.header .r { width: 50px; height: 50px; line-height: 50px; position: absolute; right: 0; top: 0; } 
.mainColor { background: #14c682 !important; } 
.header .l a { font-size: 18px; color: white; display: block; width: 100%; height: 100%; text-align: center; }
.header .m a i {float: left;margin: 23px 0 0 5px;width: 0;height: 0;border-width: 6px 6px 0;border-style: solid;border-color: white transparent transparent;position: absolute;}
.selectList {position: fixed;left: 0;right: 0;top: 0;bottom: 0;-webkit-box-sizing: border-box;box-sizing: border-box;background-color: rgba(0,0,0,.53);text-align: center;z-index: 30;font-size: 20px;    color: #fe6700;}
.selectList .single {position: absolute;left: 6%;right: 6%;top: 35%;padding: 0 20px;background-color: #fff;padding-bottom: 33px;padding-top: 10px;}
.selectList ul {width: 100%;height: auto;overflow: auto;}
.selectList ul li {height: 50px;line-height: 50px;border-bottom: 1px solid #e9e9e9;padding: 0 10px;}
.selectList ul li span.ri {height: 50px;line-height: 50px;font-size: 16px;}
body {background-color: #E7FAFF;}
#wd{background-color: #ff635b; border: 1px solid #ff635b; color: #fff; border-radius: 3px;font-size: 12px; height: 16px;line-height: 14px;padding: 1px 2px;margin: 0 1px;}
#del{background-color: #D81818; border: 1px solid #D81818; color: #fff; border-radius: 5px;font-size: 12px; height: 16px;line-height: 14px;padding: 1px 2px;margin: 0 1px;}
</style>
<script type="text/javascript" src="{MODULE_URL}public/mobile/js/jquery-1.11.3.min.js?v=4.8"></script>
<title>{$school['title']}</title>
{php include $this->template('port');}
</head>
<body>
<div id="titlebar" class="header mainColor">
	<div class="l">
		<a class="backOff" style="background:url({OSSURL}public/mobile/img/ic_arrow_left_48px_white.svg) no-repeat;background-size: 55% 55%;background-position: 50%;" href="javascript:history.go(-1);"></a>
	</div>
	<div class="m">
		<a id="showbjlist">
			<span style="font-size: 18px">{$bjidname['sname']}</span>
			<i></i>
		</a>
	</div>
</div>
<div class="top_height_blank"></div>
<div class=" manual_list">
<div class="manual_student_list_search">
	<input type="text" value="" placeholder="请输入{$school['shoucename']}关键字" class="search_text">
	<div class="search_btn"></div>
</div>
<div class="blank"></div>
    <ul class="manual_list_ul">
	{loop $list $row}
		<li style="border-radius: 3%;">
			<a class="li_text" href="{php echo $this->createMobileUrl('shoucepl', array('schoolid' => $schoolid,'scid' => $row['id'],'setid' => $row['setid'],'bj_id' => $row['bj_id']), true)}">
				<div class="li_img">
					<img src="{php echo tomedia($row['icon'])}" style="border-radius:5%;">
				</div>
				<div class="til1">{$row['title']}</div>
				<div class="til1">{$row['bjname']}&nbsp;{$row['xqname']}</div>
				<div class="til2 til_time">{php echo date('Y.m.d',$row['starttime'])} - {php echo date('Y.m.d',$row['endtime'])}</div>
				<div class="small_blank">{$row['kcnmae']}</div>
				<div class="til3">
					<span class='f_red' id="wd">{if $row['sendtype'] ==1}未发送{/if}{if $row['sendtype'] ==2}部分发送{/if}{if $row['sendtype'] ==3}全部已发{/if}</span>
				</div>
			</a>
			<a>
				<div class="til3 " style="position:absolute; right:0px; bottom:15px; line-height:22px; width:80px; text-align:center; z-index:2; color:#888;">
					{if $row['tid'] ==$it['tid'] || $njzr || $teacher['status'] ==2}<span class="delete_btn" id="del" contactid="{$row['id']}" msg_type ="contact_record">删除</span>{/if}
				</div>
			</a>
			<div class="clear1"></div>
		</li>
	{/loop}	
    </ul>
</div>
<div class="h_50px"></div>
<div class="manual_bottom">
    <div class="float_left mb_cell mb_l">创建联系手册</div>
    <div class="float_left mb_cell mb_r">评语库管理</div>
</div>
<div class="clear"></div>
<div class="selectList" id="selectList" style="z-index:100000;display:none;">
	<div class="single" style="border-radius: 10px;"">
		<ul>
			<span style="color:#444;">切换班级</span>
			{loop $bjlist $row}
				{if $row['sid'] !=$teacher['bj_id1'] && $row['sid'] !=$teacher['bj_id2'] && $row['sid'] !=$teacher['bj_id3']}
				<li onclick="isSelect('{$row['sid']}');"><span class="ri">{$row['sname']}</span></li>
				{/if}
			{/loop}
				{if $bj1}<li onclick="isSelect('{$bj1['sid']}');"><span class="ri">{$bj1['sname']}</span></li>{/if}
				{if $bj2}<li onclick="isSelect('{$bj2['sid']}');"><span class="ri">{$bj2['sname']}</span></li>{/if}
				{if $bj3}<li onclick="isSelect('{$bj3['sid']}');"><span class="ri">{$bj3['sname']}</span></li>{/if}
		</ul>
	</div>
</div>
</body>
</html>
<script>
	$("#showbjlist").on('click', function () {
		$('#selectList').show();
	});
	$(".mb_l").on("click", function () {
		window.location.href = "{php echo $this->createMobileUrl('shouceadd', array('schoolid' => $schoolid), true)}";
	});

	$(".mb_r").on("click", function () {
		window.location.href = "{php echo $this->createMobileUrl('shoucepygl', array('schoolid' => $schoolid), true)}";
	});
	function isSelect(bjid){
		jTips("数据加载中！···");
		location.href = "{php echo $this->createMobileUrl('shoucelist', array('schoolid' => $schoolid), true)}"+ '&bj_id=' + bjid;
	}
	$(".search_text").on("input propertychange", function () {
		var search_text = $.trim($(this).val());
		if (search_text == '') {
			$(".manual_list_ul li").show();
		} else {
			$(".manual_list_ul li").each(function () {
				if ($(this).find(".til1").text().indexOf(search_text) != -1) {
					$(this).show();
				} else {
					$(this).hide();
				}
			})
		}
	});	
	// 点击删除日志图标
	$(".manual_list_ul").on("click", ".delete_btn", function (event) {
		event.stopPropagation();
		event.preventDefault();
		var $this = $(this);
		var msgType = $this.attr("msg_type");
		if (msgType == "contact_record") {
			jConfirm("确认要删除吗？删除后所有资料将丢失", "删除确定对话框", function (isConfirm) {
				if (isConfirm) {
					$.ajax({
						url: "{php echo $this->createMobileUrl('shoucelist', array('schoolid' => $schoolid,'op' => 'del'), true)}",
						type: "post",
						dataType: "json",
						data: {
							"id": $this.attr("contactid"),
							"tid": "{$it['tid']}"
						},
						success: function (data) {
							jTips(data.info, function () {
								if (data.status == 1) {
									//  clear_page_session("parent_diary_baby");
									//location.href = "/1046/Manual";
									$this.closest('li').remove();
								}
							});
						}
					});
				}
			});
		}
	})

</script>
